#include "i2c_slave.h"



void i2c_slave_config(void){	
	  I2C_DeInit();
	  /* Initialize I2C peripheral */
	
#ifdef I2C_slave_7Bits_Address
	  I2C_Init(100000, SLAVE_ADDRESS, I2C_DUTYCYCLE_2, I2C_ACK_CURR, I2C_ADDMODE_7BIT, 16); 		  
#else
	  I2C_Init(100000, SLAVE_ADDRESS, I2C_DUTYCYCLE_2, I2C_ACK_CURR,I2C_ADDMODE_10BIT, 16);
#endif
	
	  /* Enable Error Interrupt*/
	  I2C_ITConfig((I2C_IT_TypeDef)(I2C_IT_ERR | I2C_IT_EVT | I2C_IT_BUF), ENABLE);
	
	  /* Enable general interrupts */
	  enableInterrupts();

}
